module.exports = app => {
    const { STRING, INTEGER, DATE, BIGINT, TINYINT } = app.Sequelize;

    const Banner = app.model.define('banner', {
        banner_id: {
            type: BIGINT.UNSIGNED,
            primaryKey: true,
            autoIncrement: true,
        },
        image_url: { type: STRING(255), allowNull: false },
        link_url: { type: STRING(255), allowNull: true },
        title: { type: STRING(100), allowNull: true },
        display_order: { type: INTEGER, allowNull: false },
        is_active: { type: TINYINT, allowNull: false, defaultValue: 1 },
        created_at: DATE,
        updated_at: DATE,
    }, {
        tableName: 'banners',
        timestamps: false,
    });

    return Banner;
};